package com.ruoyi.worklog.service;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.worklog.domain.WlProject;
import com.ruoyi.worklog.domain.WlStaffProject;
import com.ruoyi.worklog.mapper.WlStaffProjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author cw
 * @Date 2022/7/22 - 07 - 22
 * @Description com.ruoyi.worklog.service
 */
@Service
public class StaffProjectServiceImpl implements StaffProjectService{

    @Autowired
    private WlStaffProjectMapper wlStaffProjectMapper;

    @Override
    public WlStaffProject selectWlStaffProject(WlStaffProject wlStaffProject) {
        return wlStaffProjectMapper.selectWlStaffProject(wlStaffProject);
    }

    @Override
    public List<Integer> selectProjectIds(long staffId) {
        return wlStaffProjectMapper.selectProjectIds(staffId);
    }

    @Override
    public List<Long> selectStaffIds(int projectId) {
        return wlStaffProjectMapper.selectStaffIds(projectId);
    }

    @Override
    public int insertWlStaffProject(WlStaffProject wlStaffProject) {
        return wlStaffProjectMapper.insertWlStaffProject(wlStaffProject);
    }

    @Override
    public int updateWlStaffProject(WlStaffProject wlStaffProject) {
        return wlStaffProjectMapper.updateWlStaffProject(wlStaffProject);
    }

    @Override
    public int deleteWlStaffProject(WlStaffProject wlStaffProject) {
        return wlStaffProjectMapper.deleteWlStaffProject(wlStaffProject.getStaff_id(),wlStaffProject.getProject_id());
    }

    @Override
    public int deleteWlStaffProjectByProjectId(int projectId) {
        return wlStaffProjectMapper.deleteWlStaffProjectByProjectId(projectId);
    }

    @Override
    public int deleteWlStaffProjectByStaffId(long staffId) {
        return wlStaffProjectMapper.deleteWlStaffProjectByStaffId(staffId);
    }
}
